<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Memory Leak</title>
</head>
<body>
  <button id="grow">start</button>
  <script>
    // 点击按钮，就执行一次函数，申请一块内存
    var arr = [];
    function grow() {
      var a = new Array(2000000).fill(1);
      var b = new Array(2000000).fill(1);
      arr.push(b);
    }
    document.getElementById('grow').addEventListener('click', grow);
  </script>
</body>
</html>